package cn.edu.scau.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.scau.dao.NursingLevelMapper;
import cn.edu.scau.entity.NursingLevel;
import cn.edu.scau.service.NursingLevelService;

@Service
public class NursingLevelServiceImpl implements NursingLevelService {
	@Autowired
	private NursingLevelMapper nursingLevelMapper;

	@Override
	public boolean insert(NursingLevel nursingLevel) {
		//业务逻辑判断
		int line = nursingLevelMapper.insertSelective(nursingLevel);
		return line == 1 ? true:false;
	}

	@Override
	public boolean update(NursingLevel nursingLevel) {
		//业务逻辑判断
		int line = nursingLevelMapper.updateByPrimaryKeySelective(nursingLevel);
		return line == 1 ? true:false;
	}

	@Override
	public boolean delete(Integer id) {
		//业务逻辑判断
		int line = nursingLevelMapper.deleteByPrimaryKey(id);
		return line == 1 ? true:false;
	}

	@Override
	public NursingLevel selectById(Integer id) {
		//业务逻辑判断
		return nursingLevelMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<NursingLevel> selectAll() {
		//业务逻辑判断
		return nursingLevelMapper.selectAll();
	}

	@Override
	public List<NursingLevel> findByNursinglevellevel(String nursinglevellevel) {
		//业务逻辑判断
		return nursingLevelMapper.findByNursinglevellevel(nursinglevellevel);
	}

}
